# coding=utf-8
import requests

class URLResponse:
#    headers = {
#        'Host':"sou.zhaopin.com",
#        "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
#        "Accept-Encoding": "gzip, deflate",
#        "Accept-Language": "zh-CN,zh;q=0.9",
#        "Connection": "keep-alive",
#        "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
#    }
    headers = {
        'Host':"search.51job.com",
        "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "Accept-Encoding": "gzip, deflate",
        "Accept-Language": "zh-CN,zh;q=0.9",
        "Connection": "keep-alive",
        "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36",
        "Content-Type" : "application/x-www-form-urlencoded",
        "Origin" : "http://search.51job.com",
        "Cache-Control" : "max-age=0",
        "Upgrade-Insecure-Requests" : "1"
    }
    def __init__(self, url):
        self.url = url
        
    def getHtml(self, method = 'get', data = {}, headers = {}):
        if method == 'get':
            return requests.get(self.url, headers = headers, timeout = 10)
        
        
    
